package com.yuanfeng.payment.controller;

import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.payment.dto.ThirdAuthReturnDTO;
import com.yuanfeng.payment.dto.WithdrawRequestDTO;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName PayFxAccountController
 * @Description
 * @Author hyq
 * @Date 2023/8/25 9:39
 * @Version 1.0
 **/
@CrossOrigin
@RestController
@RequestMapping("pay/fxAccount")
public class PayFxAccountController extends BaseController{


    /**
     * 保存用户授权信息
     *
     * @param param
     * @return
     */
    @PostMapping("/updateUserAuthInfo")
    public ResponseResult updateUserAuthInfo(@RequestBody ThirdAuthReturnDTO param) {
        ResponseResult result=payFxAccountService.updateUserAuthInfo(param);
        return result;
    }

    /**
     * 用户提现
     * @param withdrawRequest
     * @param request
     * @return
     */
    @RequestMapping("/withdraw")
    public ResponseResult withdraw(@RequestBody WithdrawRequestDTO withdrawRequest, HttpServletRequest request){
        ResponseResult result=payFxAccountService.withdraw(withdrawRequest,request);
        return result;
    }

}
